function xmlStringParser(){
	var txt="<note>";
	txt=txt+"<to>Tom</to>";
	txt=txt+"<from>Jerry</from>";
	txt=txt+"<heading>Reminder</heading>";
	txt=txt+"<body>weekend!</body>";
	txt=txt+"</note>";

	var xmlDoc;
	if (window.DOMParser){
		parser=new DOMParser();
		xmlDoc=parser.parseFromString(txt,"text/xml");
	}
	else // Internet Explorer
	{
		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async="false";
		xmlDoc.loadXML(txt); 
	} 
	return xmlDoc;
}

function textXMLParse(){
	var xmlDoc = xmlStringParser();
	document.write("<br/>");
	document.write(
		xmlDoc.getElementsByTagName("to")[0].childNodes[0].nodeValue);
	document.write("<br/>");
	document.write(
		xmlDoc.getElementsByTagName("from")[0].childNodes[0].nodeValue);
	document.write("<br/>");
	document.write(
		xmlDoc.getElementsByTagName("body")[0].childNodes[0].nodeValue);
		
}

function xmlHttpPost(strURL,qryStr) {
	var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    var passArgs;
    if(arguments.length > 2){
    	passArgs = new Array()
    	for(var i=2;i<arguments.length;i++){
    		passArgs[i-2] = arguments[i];
    	}
    }
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(self.xmlHttpReq.responseText,passArgs);
        }
    }
    self.xmlHttpReq.send(qryStr);
}


